package com.annotation.tx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author: qiuli
 * @date: 2022/1/19 18:42
 * @description:
 */


@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    @Transactional
    public void insertUser() {
        userDao.insert();
        int a = 1 / 0;
        System.out.println("插入完成...");
    }

    public void selectById() {
        userDao.select();
    }

}

